<?php

namespace App\Http\Controllers\Api\V1\Resources;

use Illuminate\Http\Resources\Json\JsonResource;
use App\Models\YaoDivination;
use Illuminate\Support\Facades\Storage;

class StylesResource extends JsonResource
{
    public function toArray($request)
    {
    	$resource = $this->resource;
    	
        
        return [
        	'id' => (int)$resource->id,
            'name'=>$resource->name,
            'image'=>isset($resource->image) ? Storage::disk('public')->url($resource->image) : '',
	        'created_at' => date("Y-m-d",strtotime((string)$resource->created_at)),
        ];
    }
}
